#include <iostream>
using namespace std;


int main(){
	int t;
	cin>>t;
	for(int k=0;k<t;k++){
		int n,m;
		cin>>n>>m;
		int a[n],b[m];
		int maxa1=-1,minb1=-1;
		int maxa2=-1;
		bool ad1=false,bd1=false;
		bool ad2=false;
		for(int i=0;i<n;i++){
			cin>>a[i];
			if(!ad1){
				ad1 = true;
				maxa1 = a[i];
			}
			else if(maxa1 < a[i]){
				ad2 = true;
				maxa2 = maxa1;
				maxa1 = a[i];
			}
			else if(a[i] > maxa2){
				ad2 = true;
				maxa2 = a[i];
			}
		}
		
		for(int i=0;i<m;i++){
			cin>>b[i];
			if(!bd1  ||  minb1 > b[i]){
				bd1 = true;
				minb1 = b[i];
			}
		}
		
		bool chan=false;
		for(int i=0;i<m;i++){
			if(b[i] != maxa1  &&  !ad2){
				chan = true;
				break;
			}
		}
		
		if(minb1 > maxa1  &&  m == 1)
			chan = true;
		
		if(maxa1 > minb1  ||  chan){
			cout<<-1<<endl;
			continue;
		}
		
		int sum=0;
		for(int i=0;i<m;i++)
			sum += b[i];
		
		for(int i=0;i<n;i++){
			sum += a[i]*m;
		}
		
		sum -= maxa1*m;
		if(maxa1 != minb1)
			sum += maxa1-maxa2;
		
		cout<<sum<<endl;
	}
	return 0;
}
